<?php

/*
 * Code/CodeController.php
 */

namespace RHX\Model\Code;

class CodeController {

    /**
     * Récupération du Code Activité
     *
     * @param int $id
     * @return AbstractCode
     */
    public static function getCode($id) {
	switch ($id) {
	    case Code::ABSENT:
		return new Absent();
	    case Code::ACCIDENT_TRAVAIL:
		return new AccidentTravail();
	    case Code::ARRET_MALADIE1:
		return new ArretMaladie();
	    case Code::ARRET_MALADIE2:
		return new ArretMaladie();
	    case Code::CONGE_MATERNITE:
		return new CongeMaternite();
	    case Code::CONGE_MATERNITE_PERE:
		return new CongeMaternitePere();
	    case Code::CONGE_PAYE:
		return new CongePaye();
	    case Code::CONGE_PAYE_EXCEPTIONEL:
		return new CongePayeExceptionel();
	    case Code::CONGE_SANS_SOLDE:
		return new CongeSansSolde();
	    case Code::ECOLE_FORMATION_ALTERNANCE:
		return new EcoleFormationAlternance();
	    case Code::ECOLE_FORMATION_EMPLOYE:
		return new EcoleFormationEmploye();
	    case Code::ECOLE_FORMATION_INTEGRATION:
		return new EcoleFormationIntegration();
	    case Code::FERIE_1:
		return new Ferie1();
	    case Code::FERIE_2:
		return new Ferie2();
	    case Code::FERIE_3:
		return new Ferie3();
	    case Code::FERMER:
		return new Fermer();
	    case Code::INDISPONIBLE:
		return new Indisponible();
	    case Code::NE_TRAVAILLEPAS:
		return new NeTravaillePas();
	    case Code::PRESENT:
		return new Present();
	    case Code::PROBLEME_RETARD_DEPART_ANTICIPE:
		return new ProblemeRetardDepartAnticipe();
	    case Code::INCONNUE:
	    default:
		return NULL;
	}
    }

}

?>
